package com.xbb.json2excel.controller;

import com.xbb.json2excel.service.Json2ExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: xiaomi
 * @date: 2021/7/18
 * @description:
 */
@Controller
@RequestMapping("/json2excel")
public class Json2ExcelController {

    @Autowired
    Json2ExcelService json2ExcelService;

    @GetMapping("hello")
    public String hello() {
        return "hello security";
    }

    @GetMapping("list")
    public String list() {
        return "{\n" +
                "    \"success\": true,\n" +
                "    \"msg\": \"请求成功\",\n" +
                "    \"result\": {\n" +
                "        \"total\": 123,\n" +
                "        \"pageIndex\": 0,\n" +
                "        \"limit\": 0,\n" +
                "        \"content\": [\n" +
                "            {\n" +
                "                \"customerCode\": \"TYKH20200607nNdX\",\n" +
                "                \"customerName\": \"XXX有限公司\",\n" +
                "                \"customerLevel\": \"D-普通客户\",\n" +
                "                \"customerDesc\": null,\n" +
                "                \"followStatus\": 1,\n" +
                "                \"followStatusValue\": \"状态说明\",\n" +
                "                \"bdList\": [\n" +
                "                    {\n" +
                "                        \"staffId\": \"11\",\n" +
                "                        \"name\": \"名字\",\n" +
                "                        \"tuyaName\": \"帮主\",\n" +
                "                        \"tuyaNameFullString\": \"(xx)韩\"\n" +
                "                    }\n" +
                "                ],\n" +
                "                \"buLeaderList\": null,\n" +
                "                \"mainPMList\": [\n" +
                "                    {\n" +
                "                        \"staffId\": \"11\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"Doctor\",\n" +
                "                        \"tuyaNameFullString\": \"(Doctor)xx\"\n" +
                "                    }\n" +
                "                ],\n" +
                "                \"pmList\": [\n" +
                "                    {\n" +
                "                        \"staffId\": \"11\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"xx\",\n" +
                "                        \"tuyaNameFullString\": \"(xx)xx\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"staffId\": \"11\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"x\",\n" +
                "                        \"tuyaNameFullString\": \"(xx)xx\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"staffId\": \"11\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"x\",\n" +
                "                        \"tuyaNameFullString\": \"(x)xx\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"staffId\": \"11\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"xx\",\n" +
                "                        \"tuyaNameFullString\": \"(xxx)xx\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"staffId\": \"11\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"xx\",\n" +
                "                        \"tuyaNameFullString\": \"(东君)俞文杰\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"staffId\": \"1335771160389926912\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"安迪\",\n" +
                "                        \"tuyaNameFullString\": \"(安迪)xx\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"staffId\": \"1329247361041473536\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"Rhea\",\n" +
                "                        \"tuyaNameFullString\": \"(Rhea)xx\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"staffId\": \"1381434024068718592\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"开山\",\n" +
                "                        \"tuyaNameFullString\": \"(开山)xx\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"staffId\": \"00607\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"Sally\",\n" +
                "                        \"tuyaNameFullString\": \"(Sally)xx\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"staffId\": \"02359\",\n" +
                "                        \"name\": \"xx\",\n" +
                "                        \"tuyaName\": \"林斐\",\n" +
                "                        \"tuyaNameFullString\": \"(林斐)xx\"\n" +
                "                    },                    \n" +
                "                    {\n" +
                "                        \"staffId\": \"00096\",\n" +
                "                        \"name\": \"xxx\",\n" +
                "                        \"tuyaName\": \"折颜\",\n" +
                "                        \"tuyaNameFullString\": \"(折颜)xx\"\n" +
                "                    }\n" +
                "                ],\n" +
                "                \"techSupportList\": null,\n" +
                "                \"focusList\": null,\n" +
                "                \"canCreate\": false,\n" +
                "                \"canCreateTask\": false,\n" +
                "                \"valid\": true\n" +
                "            }\n" +
                "        ]\n" +
                "    }\n" +
                "}\n" +
                "\n";
    }


    @PostMapping("list2excel")
    public String list2excel(String json) {

        return "hello security";
    }


}
